﻿using EndulceDeLeche.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace EndulceDeLeche.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            var laListaDeLinks = LinkContenedor.links;
            return View(model: laListaDeLinks);
        }

        [HttpGet]
        public ActionResult Agregar()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Agregar(Link link)
        {
            LinkContenedor.agregarLink(link);
            return RedirectToAction("Index");
        }

    }
}